import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;


public class Test {

	public static void main(String[] args) {
     	String URL = "http://api.gnavi.co.jp/ver1/CategorySmallSearchAPI/?keyid=e4127f91e8b0341265f656217d2a103a";
		String result=getURLContent(URL);
		System.out.println(result);
		
	}
	public static String getURLContent(String p_sURL)
	{
	    URL oURL;
	    URLConnection oConnection;
	    BufferedReader oReader;
	    String sLine;
	    StringBuilder sbResponse;
	    String sResponse = null;
	    String test=null;

	    try
	    {
	        oURL = new URL(p_sURL);
	        oConnection = oURL.openConnection();
	        oReader = new BufferedReader(new InputStreamReader(oConnection.getInputStream()));
	        sbResponse = new StringBuilder();

	        while((sLine = oReader.readLine()) != null)
	        {
	            sbResponse.append(sLine);
	        }

	        sResponse = sbResponse.toString();
	    }
	    catch(Exception e)
	    {
	        e.printStackTrace();
	    }

	    return sResponse;
	}
	
	
}




